﻿/*
 * Copyright 2010 Michael Georgoulopoulos
 * 
 * This file is part of Mordor - Source file comparing program.
 * 
 * Mordor is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Mordor is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Mordor.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Contact: info@convexgames.com
 * Website: http://www.convexgames.com
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Microsoft.Win32;

namespace Mordor
{
    public partial class HelpForm : Form
    {
        public HelpForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void HelpForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Convex Games\\Mordor", true);
            // this key must exist by now.
            if (checkBox1.Checked)
            {
                if (key.GetValue("hide_help") != null)
                    key.DeleteValue("hide_help");
            }
            else
            {
                key.SetValue("hide_help", 1);
            }
            key.Close();

        }

        private void HelpForm_Load(object sender, EventArgs e)
        {
            RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Convex Games\\Mordor");
            if (key.GetValue("hide_help") == null)
                checkBox1.Checked = true;
            else
                checkBox1.Checked = false;
        }
    }
}
